package com.legsem.jrhosync.samples;

import com.legsem.jhosync.Context;
import com.legsem.jhosync.face.Application;
import com.legsem.jhosync.face.JhosyncApplication;

/**
 * Application implementations must implement the {@link Application} interface
 * and have a JhosyncApplication annotation.
 * <p/>
 * Clients must authenticate before they are allowed to sync. The Application
 * determines who is authorized.
 * <p/>
 * Here, all Clients are allowed to sync.
 * 
 */
@JhosyncApplication
public class SalesmanApplication implements Application {

    public boolean authenticate(String username, String password,
            Context context) {
        // context can be used to pass data to source code
        context.setSessionAttribute("salesman.username", username);

        return true;
    }

}
